<template>
  <div class="fangke">
    <fang-ke-table
      :mydata="myData"
      :mytitle="myItems"
      type="fangke"
      :kefuItems="kefuItems"
      :sourceItems="sourceItems"
      :terminalItems="terminalItems"
    ></fang-ke-table>
  </div>
</template>

<script>
import FangKeTable from "@/components/MyTable/FangKeTable";
export default {
  components: {
    // SmartWay
    FangKeTable,
  },
  created() {
    this.$axios.get("/visitor").then((res) => {
      this.myData = res.data.visitorList;
      console.log(this.myData);
    });
  },
  mounted() {
    this.$store.commit("setTitle", "访客");
    this.$store.commit("NavStyleClear", "访客");
  },
  data() {
    return {
      myData: [],
      myItems: [
        {
          name: "访客名称",
          prop: "name",
          width: 225,
        },
        {
          name: "来源",
          prop: "origin",
          width: 159,
        },
        {
          name: "终端",
          prop: "terminal",
          width: 159,
        },
        {
          name: "访问时间",
          prop: "visitTime",
          width: 159,
        },
        {
          name: "访问时长",
          prop: "duration",
          width: 159,
        },
        {
          name: "IP地址",
          prop: "ip",
          width: 155,
        },
        {
          name: "访问状态",
          prop: "status",
          width: 126,
        },
      ],
      kefuItems: [
        {
          label: "王美美",
          value: 0,
        },
        {
          label: "七尾",
          value: 1,
        },
        {
          label: "李想",
          value: 2,
        },
        {
          label: "王志",
          value: 3,
        },
      ],
      sourceItems: [
        {
          label: "全部终端",
          value: 0,
        },
        {
          label: "Mac",
          value: 1,
        },
        {
          label: "Windows",
          value: 2,
        },

        {
          label: "手机",
          value: 3,
        },
      ],
      terminalItems: [
        {
          label: "全部终端",
          value: 0,
        },
        {
          label: "Chrome",
          value: 1,
        },
        {
          label: "App",
          value: 2,
        },

        {
          label: "小程序",
          value: 3,
        },
      ],
    };
  },
};
</script>

<style>
.fangke {
  background-color: #ffffff;
  padding: 10px 20px;
  height: 100%;
}
</style>